<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <script>
    var str = 'beautiful 女孩!';
    console.log(str.match(/[abc]/g));   // 输出结果：(2) ["b", "a"]
    console.log(str.match(/[^a-z]/g));  // 输出结果：(4) [" ", "女", "孩", "!"]
  </script>
</body>
</html>